﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using ScrumTable.Common;
using ScrumTable.Common.Collections;
using ScrumTable.DL.Data.Common;
using ScrumTable.DL.Data.Generic.Cache;
using ScrumTable.DL.Data.Schema;
using ScrumTable.DL.Data.Schema.ScrumTableV1;

#endregion

namespace ScrumTable.DL.Data.Generic
{
    /// <summary>
    /// This class contains the save errors provided by the underlying
    /// data driver occurred during the save procedure.
    /// </summary>
    public class DataSyncError : IDataSyncError
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the id chain of the element which raised the error.
        /// </summary>
        public ValueChain<string> IdChain { get; private set; }

        /// <summary>
        /// Gets a list of error information which contain additional details
        /// of the sync error.
        /// </summary>
        public IList<IDataSyncErrorInfo> ErrorInfo { get; private set; }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="DataSyncError"/> class.
        /// </summary>
        /// <param name="idChain">Specifies the chain of the element which caused the error.</param>
        /// /// <param name="errorInfo">Specifies the back end error information.</param>
        internal DataSyncError(ValueChain<string> idChain, IList<IDataSyncErrorInfo> errorInfo)
        {
            PreCondition.AssertNotNull(idChain, "idChain");
            PreCondition.AssertNotNull(errorInfo, "errorInfo");

            IdChain = idChain;
            ErrorInfo = errorInfo;
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------
        #endregion

    }
}